-
-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(barcode-scanning): add delay before starting camera session #188
Conversation
@capacitor-mlkit/barcode-scanning
@capacitor-mlkit/face-detection
@capacitor-mlkit/face-mesh-detection
@capacitor-mlkit/selfie-segmentation
@capacitor-mlkit/translation
commit: |
When will this be released? |
@TimvdEijnden I was still waiting to see if there would be more feedback. |
I can try the pkg.new version, because I got an issue only on iOS that the camera is not showing up |
Thanks @robingenz for tackling the camera issue. While the 0.1s delay might help in some cases, it feels more like a temporary workaround than a solid fix. The main issue is that commitConfiguration() sometimes runs asynchronously, causing startRunning() to be called prematurely. Ideally, the solution should ensure commitConfiguration() fully completes before proceeding, without relying on a fixed delay. We've tested this approach in another project (PR: cardano-foundation/cf-identity-wallet#772) and found that the delay didn't consistently resolve the issue. A more reliable method would be preferable. Error: *** Terminating app due to uncaught exception 'NSGenericException', reason: '*** -[AVCaptureSession startRunning] startRunning may not be called between calls to beginConfiguration and commitConfiguration'
*** First throw call stack:
(0x18441908c 0x18171b2e4 0x1a25838f0 0x104a86d84 0x1063d8d68 0x1063d8de8 0x105a84a30 0x105a8671c 0x105a9ae58 0x105a9b618 0x20b78bc40 0x20b788488)
libc++abi: terminating due to uncaught exception of type NSException |
@jimcase Yes, I know that's not an ideal solution. Unfortunately, I can't think of any other solution at the moment. If you have an idea, you are welcome to create a PR and I'll take a look at it. |
Hey @robingenz, I just created a PR with a solution using serial DispatchQueue(FIFO) to sequentially run the configuration and the start of the session |
Pull request checklist
Please check if your PR fulfills the following requirements:
npm run changeset
).Close #176